<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue组件生命周期</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
    <div id="Application">
        <comp1></comp1>
    </div>
    <script>
        const App = Vue.createApp({})
        const comp2 = {
            template:`
                <div>
                    组件2
                </div>
            `
        }
        const comp1 = {
            components:{
                'comp2':comp2
            },
            template:`
                <div>
                    组件1
                    <comp2></comp2>
                </div>
            `
        }
        
        App.component("comp1", comp1)
        App.mount("#Application") 
    </script>
</body>
</html>